﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once
#include "GcmpCommandAction.h"
#include "Vector3d.h"

namespace gcmp
{
    /// \brief 输入状态
    enum class InputState : int32_t
    {
        None = 0,///< 无输入状态
        Length = 1,///< 长度输入状态
        Angle = 2,///< 角度输入状态
        Radius = 3,///< 半径输入状态
        CentralAngle = 4,///< 圆心角输入状态
        Width = 5,///< 矩形宽度输入状态
        Height = 6,///< 矩形高度输入状态
    };

    /// \brief 临时尺寸标注样式
    struct GCMP_COMMAND_ACTION_EXPORT TemporaryDimensionStyle
    {
        TemporaryDimensionStyle()
        {
            GlobalScale = 1.0;
            CharSize = 16.0;
            TextOffset = 4.0;
            LengthPrecision = 2;
            AnglePrecision = 2;
            RadiusPrecision = 2;
            EditorHeight = 20;
            EditorWidth = 60;
            DimensionArrowSize = 16.0;
            LengthDimensionLineOffset = 44.0;
            AngleDimensionArcRadius = 200.0;
        }
        double GlobalScale; ///<  全局尺寸 
        float CharSize;///<  临时标注文字大小
        double TextOffset;///<  临时标注文字偏移标注线的距离
        int LengthPrecision;///<  长度显示精度
        int AnglePrecision;///<  角度显示精度
        int RadiusPrecision;///<  半径显示精度 
        int EditorWidth;///<  输入框宽度
        int EditorHeight;///<  输入框高度
        double DimensionArrowSize;///<  标头箭头像素大小
        double LengthDimensionLineOffset;///<  长度标注线偏移像素
        double AngleDimensionArcRadius;///<  全局尺寸角度标注弧半径
    };

    /// \brief 临时尺寸标注信息
    struct GCMP_COMMAND_ACTION_EXPORT TemporaryDimensionData
    {
        TemporaryDimensionData()
        {
            LengthDimensionPosition = Vector3d::Zero;
            LengthValue = 0.0;
            AngleDimensionPosition = Vector3d::Zero;
            AngleValue = 0.0;
            RadiusDimensionPosition = Vector3d::Zero;
            RadiusValue = 0.0;
            CentralAngleDimensionPosition = Vector3d::Zero;
            CentralAngleValue = 0.0;
            WidthDimensionPosition = Vector3d::Zero;
            WidthValue = 0.0;
            HeightDimensionPosition = Vector3d::Zero;
            HeightValue = 0.0;
        }

        Vector3d LengthDimensionPosition;///< 长度临时标注文字的位置
        double LengthValue;///<长度值
        Vector3d AngleDimensionPosition;///<角度临时标注文字的位置
        double AngleValue;///<角度值
        Vector3d RadiusDimensionPosition;///<半径临时标注文字的位置
        double RadiusValue;///<半径值
        Vector3d CentralAngleDimensionPosition;///<圆心角临时标注文字的位置
        double CentralAngleValue;///<圆心角值
        Vector3d WidthDimensionPosition;///<矩形宽度临时标注文字的位置
        double WidthValue;///<矩形宽度值
        Vector3d HeightDimensionPosition;///<矩形高度临时标注文字的位置
        double HeightValue;///<矩形高度值
    };
}

